package lab.javacore.collections.student;

import java.util.Arrays;
import java.util.List;

public class Enrolment {

	public static void main(String args[]){
				
		List<Student> group1 = Arrays.asList(
				new Student(1,"Ali","ali@temp.com"),
				new Student(2,"Ahmad","ahmad@temp.com"),
				new Student(3,"Abid","abid@temp.com")
		);
		
		List<Student> group2 = Arrays.asList(
				new Student(4,"Akbar","akbar@temp.com"),
				new Student(5,"Robert","robert@temp.com")
		);
		
		List<Session> list = Arrays.asList(
				new Session(1,Course.getList().get(new Integer(1)),2.5,Trainer.getList().get(1),group1),
				new Session(2,Course.getList().get(new Integer(2)),2.5,Trainer.getList().get(1),group1),
				new Session(3,Course.getList().get(new Integer(2)),2.5,Trainer.getList().get(2),group2),
				new Session(3,Course.getList().get(new Integer(3)),2.5,Trainer.getList().get(2),group2)
		);
		
		for (Session s : list) {
			System.out.println("Session ID : " + s.getId());
			System.out.println("Session Duration : " + s.getDuration());
			System.out.println("Courses : " + s.getCourse().getName());
			
			System.out.println("Trainer: " + s.getTrainer().getName());
			
			System.out.print("Students : ");
			List<Student> students = s.getStudents();
			for (Student std: students){
				System.out.print(std.getName() + ",");
			}
			
			System.out.println("");
		}
	}
}
